
@extends('layouts.admin')
@section('contents')
<!--面包屑导航 开始-->
<div class="crumb_warp">
    <!--<i class="fa fa-bell"></i> 欢迎使用登陆网站后台，建站的首选工具。-->
    <i class="fa fa-home"></i> <a href="#">首页</a> &raquo; 修改分类
</div>
<!--面包屑导航 结束-->
<!--结果页快捷搜索框 开始-->
<div class="search_wrap">
    <form action="" method="post">
        <table class="search_tab">
            <tr>
                <th width="120">选择分类:</th>
                <td>
                    <select onchange="javascript:location.href=this.value;">
                        <option value="">全部</option>
                        <option value="http://www.baidu.com">百度</option>
                        <option value="http://www.sina.com">新浪</option>
                    </select>
                </td>
                <th width="70">关键字:</th>
                <td><input type="text" name="keywords" placeholder="关键字"></td>
                <td><input type="submit" name="sub" value="查询"></td>
            </tr>
        </table>
    </form>
</div>
<!--结果页快捷搜索框 结束-->

<!--结果集标题与导航组件 开始-->
<div class="result_wrap">
    <div class="result_title">
        <h3>修改分类</h3>
        <!--快捷导航 开始-->
        <div class="result_content">
            <div class="short_wrap">
                <a href="{{url('admin/category/create')}}"><i class="fa fa-plus"></i>新增分类</a>
                <a href="{{url('admin/category')}}"><i class="fa fa-recycle"></i>全部分类</a>
            </div>
        </div>
        <!--快捷导航 结束-->
        @if(count($errors) > 0)
            <div class="mark"> 
            @if(is_object($errors))
                @foreach($errors->all() as $error)
                <p>{{$error}}</p>
                @endforeach
            @else
                <p>{{$errors}}</p>
            @endif
            </div>
        @endif
    </div>
</div>

<div class="result_wrap">
    <form action="{{url('admin/category/'.$field->cate_id)}}" method="post">
        <input type="hidden" name="_method" value="put" />
        {{csrf_field()}}
        <table class="add_tab">
            <tbody>
                <tr>
                    <th width="120"><i class="require">*</i>父级分类：</th>
                    <td>
                        <select name="cate_parentid">
                            <option value="0">==顶级分类==</option>
                            @foreach($data as $d)
                            <option value="{{$d->cate_id}}"
                                    @if($d->cate_id == $field->cate_parentid)
                                        selected
                                    @endif
                            >{{$d->cate_name}}</option>
                            @endforeach
                        </select>
                    </td>
                </tr>
                <tr>
                    <th><i class="require">*</i>分类名称：</th>
                    <td>
                        <input type="text" class="lg" name="cate_name" value="{{$field->cate_name}}">
                        分类名称必须填写
                    </td>
                </tr>
                <tr>
                    <th>分类标题：</th>
                    <td>
                        <input type="text" class="lg" name="cate_title" value="{{$field->cate_title}}">
                    </td>
                </tr>
                <tr>
                    <th>关键字：</th>
                    <td>
                        <textarea name="cate_keywords">{{$field->cate_keywords}}</textarea>
                    </td>
                </tr>
                <tr>
                    <th>分类描述：</th>
                    <td>
                        <textarea name="cate_description">{{$field->cate_description}}</textarea>
                    </td>
                </tr>
                <tr>
                    <th><i class="require">*</i>排序：</th>
                    <td>
                        <input type="text" class="lg" name="cate_order" value="{{$field->cate_order}}">
                    </td>
                </tr>
                <tr>
                    <th></th>
                    <td>
                        <input type="submit" value="提交">
                        <a class="back" href="{{url('admin/category')}}">返回</a>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
</div>
@endsection


